import http from '../../utils/http'
import { loadingFun } from '../../utils/tools'
import { requestPayment } from '../../utils/wx'
import { showModel, showNotify, showToast, showDialog } from '../../utils/index'
import { isLogin, toLogin, getUserInfo, clearCacheAll } from '../../utils/auth'

Page({

    /**
     * 页面的初始数据
     */
    data: {
        orderList: [],

        queryParams: {
            page: 1,
            limit: 100000
        },
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        // 用户登录信息
        this.setData({ userInfo: getUserInfo() });

        this.getOrderList()
    },

    /**
     * 请求数据
     * @param {*} queryParams 
     * @returns 
     */
    async getOrderList() {
        let { queryParams, userInfo } = this.data
        queryParams.refereeMemberId = userInfo.id

        let res = await http.get('/api/mall/umsmember/getMyDistribution', queryParams)

        this.setData({ orderList: res.data.records })
    },

})